Predefined and Specific Formats for Data Types |
|
Predefined Formats for Data Types
Process Platform XForms provides you with various predefined formats for the Integer, String, and Date data types. You can select the appropriate format from the Predefined Format drop-down list in the Format tab of the Formatting Options dialog box.
Table 1. Available predefined formats
Data Type | Predefined Format | Script |
---|---|---|
Integer | Credit Card | creditcard |
String | Text | text |
Date | short date (for example, 8/15/1980) | shortdate |
short date-short time (for example, 8/15/1980 20:55) | shortdate shorttime | |
short date-long time (for example, 8/15/1980 8:55:01PM) | shortdate longtime | |
long date (for example, Friday, August 15, 1980) | longdate | |
long date-short time (for example, Friday, August 15, 1980 20:55) | longdate shorttime | |
long date-long time (for example, Friday, August 15, 1980 8:55:01) | longdate longtime | |
long time (for example, 8:55:01 PM) | longtime | |
short time (for example, 20:55) | shorttime |
You can use the values mentioned in the
Script column to programmatically set the data type for a control. For more information, see Format Type.
Specific Formats for Data Types
For each data type, you can specify the exact format in which values must be entered in a control. You can type the appropriate format in the Specific Format field in the Format tab of the Formatting Options dialog box.
Table 2. Characters supported for number formats
Character | Character Name | Description |
---|---|---|
0 | Zero placeholder | If the value that is being formatted does not have a number in the 0's position, then 0 is copied. Otherwise, that number is retained. |
# | Digit placeholder | If the value that is being formatted has a number in the #'s position, then that number is copied. Otherwise, nothing is stored in that position. |
. | Decimal placeholder | This determines the location of the decimal separator in the formatted value. |
, | Thousand separator | This specifies whether a comma separator is to be used in the formatted value or not. |
% | Percentage placeholder | The value is multiplied by 100 before formatting it. The percentage sign displays as specified in the formatted value. |
Other characters | All other characters | All other characters remain in the same position as they appear. |
Note:
- You can use only the #, ., and 0 characters to define the format for the Amount data type.
- Depending on locale settings, the decimal placeholder and thousand separator are used interchangeably.
Table 3. Characters supported for date formats
Character Character Name d, dd, D, or DD Date ddd, dddd Weekday M, MM Month MMM Abbreviated month name MMMM Month name yy, yyyy, YY, or YYYY Year H, HH Hour in 24hr time format h, hh Hour in 12hr time format m, mm Minute s, ss Second f, ff, fff Millisecond
Note: - While defining the display format for a date, you can specify the number of digits to be displayed for milliseconds (.f, .ff, or .fff). If, at run time, you enter more than the specified number of digits, a truncated value is displayed. Existing database values are also truncated and displayed according to the specified display format. However, millisecond values are saved upto a maximum of three places of decimals, if available.
- You can use of two digit (day), four digit (day+month), or eight digit (day+month+year) numbers without separators, to specify dates. The date is formatted based on the locale's shortdate format. For example, if you type 10302007, the application automatically formats it as 10/30/2007 for the
English (United States) locale.
You can use various combinations of characters to specify formats.
Table 4. Sample formats for numerical data types
Specific format Backend value Result displayed at run time 0#,##0.00 12345678.9 12,345,678.90 (##)-##0 12341234567 (1)-23412(34)-567 #### 123.45 123 #0.# % 0.7589 75.8% 0000.00 12.2 0012.20
Table 5. Sample formats for the Date data type
Specific format Result displayed at run time dd-MMM-yyyy 03-Jul-1980 dd/MMMM/yy 03-July-80 YYYY-MM-DD HH:mm:ss:fff 1980-07-03 15:40:22:325
Note: The predefined formats available for various data types depend on the locale settings of your computer.